package arithmetic2;

/**
 * Created by AJie on 2019/6/14
 * Function :
 */
public class TreeNode {
    public int val;
    public TreeNode left;
    public TreeNode right;
    public TreeNode(int x) {
        val = x;
    }

    /**
     *      5
     *  3      8
     * 1  4   6  10
     */
    public static TreeNode getTreeRootNode() {
        /**
         *      5
         *  3      8
         * 1  4   6  10
         */
        TreeNode treeRoot = new TreeNode(5);
        TreeNode tree3 = new TreeNode(3);
        TreeNode tree1 = new TreeNode(1);
        TreeNode tree4 = new TreeNode(4);
        TreeNode tree8 = new TreeNode(8);
        TreeNode tree6 = new TreeNode(6);
        TreeNode tree10 = new TreeNode(10);
        treeRoot.left = tree3;
        tree3.left=tree1;
        tree3.right=tree4;
        treeRoot.right=tree8;
        tree8.left=tree6;
        tree8.right=tree10;
        return treeRoot;
    }
}
